home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_caveamb.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  104 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_CaveAmb.cog
  4. #
  5. # Produces random ambient cave sounds when attatched to a ghost object.
  6. # Based on code from TEO_Drops.cog by SXC.
  7. #
  8. # [TRM & SXC] [GGJ] [RKD]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message     crossed
  16.     message     pulse
  17.  
  18.     thing        ghost0
  19.     thing        ghost1
  20.     thing        ghost2
  21.     thing        ghost3
  22.     thing       ghost4
  23.     
  24.     surface        SoundOn1        linkID=1
  25.     surface        SoundOn2        linkID=1
  26.     surface        SoundOff1        linkID=0
  27.     surface        SoundOff2        linkID=0
  28.     surface        SoundOff3        linkID=0
  29.         
  30.     sound       sndCave0=teo_drops1_c.wav    local
  31.     sound       sndCave1=teo_drops2_c.wav    local
  32.     sound       sndCave2=teo_drops3_c.wav    local
  33.     sound       sndCave3=teo_drops4_c.wav    local
  34.  
  35.     float       caveFreq        local
  36.     
  37.     flex        pulseTime=3.0
  38.     flex        vol=1.0
  39.     flex        minDist=-1
  40.     flex        maxDist=-1
  41.     
  42. end
  43.  
  44. # ========================================================================================
  45.  
  46. code
  47.  
  48. crossed:
  49. if (GetSenderID() == 1)
  50. {
  51.     SetPulse(pulseTime);
  52. }
  53. if (GetSenderID() == 0)
  54. {
  55.     SetPulse(0.0);
  56. }
  57.  
  58.     
  59.     return;
  60.     
  61. # ========================================================================================
  62.  
  63. pulse:
  64.  
  65. #if (!GetSectorFlags(GetThingSector(GetLocalPlayerThing())) & 0x2)
  66.  
  67. if (GetThingFlags(GetLocalPlayerThing()) & 0x2000000)
  68. {
  69.     Print("swimming");
  70.     return;
  71. }
  72.  
  73.  
  74.     
  75.     caveFreq = Rand();
  76.  
  77.     if (caveFreq < 0.16)
  78.         {
  79.             PlaySoundThing(sndCave0, ghost0[randbetween(0, 4)], vol, minDist, maxDist, 0x0);
  80.         }
  81.         
  82.     if ((caveFreq > 0.16) && (caveFreq < 0.32))
  83.         {
  84.             PlaySoundThing(sndCave1, ghost0[randbetween(0, 4)], vol, minDist, maxDist, 0x0);
  85.         }
  86.         
  87.     if ((caveFreq > 0.32) && (caveFreq < 0.48))
  88.         {
  89.             PlaySoundThing(sndCave2, ghost0[randbetween(0, 4)], vol, minDist, maxDist, 0x0);
  90.         }
  91.     
  92.     if ((caveFreq > 0.48) && (caveFreq < 0.64))
  93.         {
  94.             PlaySoundThing(sndCave3, ghost0[randbetween(0, 4)], vol, minDist, maxDist, 0x0);
  95.         }
  96.     
  97.     return;
  98.     
  99. # ========================================================================================
  100.         
  101. end
  102.  
  103.  
  104.